package com.haiyou.dc.design.装饰模式;

import java.util.List;

public class BlockList {

    private List list;

    public BlockList(List list) {
        this.list = list;
    }

    public void add(Object object) throws Exception {
        if (object == null) {
            throw new Exception("空指针异常");
        }
        list.add(object);
    }
}
